package com.superlc.ssm;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author super
 */
@Controller
@EnableTransactionManagement
@EnableScheduling
@SpringBootApplication(scanBasePackages = "com.superlc.ssm")
public class DemoApplication {
    @Scheduled(cron = "0 0/1 * * * ?")
    public void timerToNow(){
        System.out.println("now time:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
    }


    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}
